package it.cpyx.appengine.server.data;

import java.util.HashSet;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType=IdentityType.APPLICATION)
public class LabelData {
	
	@PrimaryKey
	@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private String urlExtension;
	
	@Persistent
	private Set<Long> textDataList;

	@Persistent
	private Set<Long> usersDataList;
	
	/**
	 * @param urlExtension
	 */
	public LabelData(String urlExtension) {
		this.urlExtension = urlExtension;
		this.textDataList=new HashSet<Long>();
		this.usersDataList=new HashSet<Long>();
	}

	public String getUrlExtension() {
		return urlExtension;
	}

	public void setUrlExtension(String urlExtension) {
		this.urlExtension = urlExtension;
	}

	public Set<Long> getTextDataList() {
		return textDataList;
	}

	public void setTextDataList(Set<Long> textDataList) {
		this.textDataList = textDataList;
	}
	
	public void addTextDataList(Long textId){
		this.textDataList.add(textId);
	}
	
	public void removeTextDataList(Long textId){
		this.textDataList.remove(textId);
	}

	public Set<Long> getUsersDataList() {
		return usersDataList;
	}

	public void setUsersDataList(Set<Long> usersDataList) {
		this.usersDataList = usersDataList;
	}
	
	public void addUsersDataList(Long textId){
		this.usersDataList.add(textId);
	}
	
	public void removeUsersDataList(Long textId){
		this.usersDataList.remove(textId);
	}

	public Long getId() {
		return id;
	}

	
}
